<!--
 * @Author: BlueSkyDream
 * @Date: 2023-04-27 16:08:46
 * @LastEditTime: 2023-04-27 16:53:02
 * @Description: 数组中有重复内容如何去重
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    /* 
      const arrList = [1,2,1,3,2,4,5,5,4,6]
      要求 : 编写代码去重
      实现方法一 : 两层for循环 傻瓜式处理方式
      
    */
    const arrList = [1,3,2,1,2,4,5,5,5,6,4,4,4,6]
    for(let i = 0 ; i < arrList.length ; i++) {
      // console.log(arrList[i]);
      for(let j = i+1 ; j < arrList.length ; j++) {
        // console.log('----------->'+arrList[j]);
        if(arrList[i] === arrList[j]){
          arrList.splice(j,1)
          j--
          // [1,2,3,2,4,5,5,6,4,6] 
          // [1,2,3,4,5,5,6,4,6]
          // [1,2,3,4,5,5,6,6]
        }
      }
    }
    
    console.log(arrList);
</script>
</body>
</html>